<?php 
	slot('title', 'VO-SER' );
	slot('header', '<h2>Welcome to the Software Engineering Room</h2>');
	slot('side_bar', ' ');
	slot('footer', ' ');
?>
<?php if($flash): ?>
<div id="flash"><?php echo $flash ?></div>
<?php endif ?>

<h3>Projects:</h3>
<ul>
	<?php if ($admin): ?>
		<?php foreach($projects as $p): ?>
			<li><?php echo link_to($p->getName(), '@project?pr_slug='.$p->getNameSlug())?> - 
			<?php echo link_to('Edit', $p->getEditUrl()) ?> - 
			<?php echo link_to('Delete', $p->getDeleteUrl(), "confirm=Are you sure you want to delete {$p->getName()}?") ?></li>
		<?php endforeach ?>
	<?php else: ?>
		<li>Owned:</li>
		<ul>
			<?php if (count($ownedProjects) > 0): ?>
				<?php foreach($ownedProjects as $p):?>
				    <li><?php echo link_to($p->getName(), '@project?pr_slug='.$p->getNameSlug())?> - 
					<?php echo link_to('Edit', $p->getEditUrl()) ?> - 
					<?php echo link_to('Delete', $p->getDeleteUrl(), "confirm=Are you sure you want to delete {$p->getName()}?") ?></li>
				<?php endforeach;?>
			<?php else: ?>
				<li>No projects</li>
			<?php endif ?>
		</ul>
		
		<li>Member of:</li>
		<ul>
			<?php if (count($memberProjects) > 0): ?>
				<?php foreach($memberProjects as $p):?>
				    <li><?php echo link_to($p->getName(), '@project?pr_slug='.$p->getNameSlug())?></li>
				<?php endforeach;?>
			<?php else: ?>
				<li>No projects</li>
			<?php endif ?>
		</ul>
	<?php endif ?>
	
</ul>

<h3>Actions:</h3>
<ul>
	<li><?php echo link_to('New Project', '@create_project') ?></li>
	<?php if($admin): ?>
	<li><?php echo link_to('New User', '@create_user') ?></li>
	<?php endif ?>
</ul>

<h3>View:</h3>
<ul>
	<li><?php echo link_to('User list', '@user_list') ?></li>
</ul>